package ru.amse.ilyin.provider.impl;

import java.io.File;

import ru.amse.ilyin.builder.DiagramBuilder;
import ru.amse.ilyin.diagram.Diagram;
import ru.amse.ilyin.provider.DiagramProvider;

/**
 * Implementation of {@link DiagramProvider} interface.
 *
 * @author Alexander Ilyin
 * 
 * @see DiagramBuilder
 */
public class DiagramProviderImpl implements DiagramProvider {
	private final DiagramBuilder builder;
	
	/**
	 * Creates new diagram provider by the specified diagram builder.
	 * 
	 * @param builder diagram builder
	 */
	public DiagramProviderImpl(DiagramBuilder builder) {
		this.builder = builder;
	}
	
	public Diagram getClassDiagram() {
		return builder.getClassDiagram(null);
	}

	public Diagram getPackageDiagram(File rootPackage) {
		return builder.getPackageDiagram(rootPackage);
	}
}
